Shader "Unlit/wxy_双面渲染"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
        _TransparentNum("TransparentNum", Range(0, 1)) = 0.5
    }
    SubShader
    {
        Tags
        {
            "Queue" = "Transparent"
            "IgnoreProjector"="True"
            "RenderOrder"="Transparent"
        }

        Pass
        {
            Tags
            {
                "LightMode"="ForwardBase"
            }
            ZWrite Off//关闭深度写入
            Blend SrcAlpha OneMinusSrcAlpha//将混合因子设置为半透明效果
            Cull Off//双面渲染
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma multi_compile_fog
            #include "UnityCG.cginc"
            #include "Lighting.cginc"


            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 pos : SV_POSITION;
            };

            sampler2D _MainTex;
            float4 _MainTex_ST;
            fixed _TransparentNum;

            v2f vert(appdata_base v)
            {
                v2f value;
                value.pos = UnityObjectToClipPos(v.vertex);
                value.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
                return value;
            }

            fixed4 frag(v2f i) : SV_Target
            {
                fixed4 col = tex2D(_MainTex, i.uv);
                return fixed4(col.rgb, col.a * _TransparentNum);
            }
            ENDCG
        }
    }
}